﻿#region Using Directives

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Xml.Linq;

    using Csla;

    using MarketPulse.BusinessLogic.Core;

#endregion

namespace MarketPulse.BusinessLogic.Private
{
    /// <summary>
    /// This class represents an indiviual event that a visit can exerience during it's lifecycle.
    /// This class has no data access factory and as such cannot be persisted outside of a vist object. 
    /// 
    /// Instances of this object belong to a visit object and their persistence and general management are handled by their owner (Visit object).
    /// </summary>
    [Serializable]
    [Csla.Server.ObjectFactory("MarketPulse.DataAccess.Factory.VisitFactory, MarketPulse.DataAccess.Factory", "CreateEvent", "" )]
    public class VisitEvent : MarketPulseBase<VisitEvent>
    {
        #region Constructors

            /// <summary>
            /// Default constructor is private in order to (try to) enforce construction
            /// only via the static factory methods provided.
            /// </summary>
            private VisitEvent()
            {
            }

        #endregion

        #region Methods

            #region Factory Methods

                /// <summary>
                /// Method that creates a new VisitEvent via the DataPortal client proxy
                /// </summary>
                /// <returns>The newly created visit object</returns>
                public static VisitEvent New()
                {
                    return DataPortal.Create<VisitEvent>();
                }

            #endregion

        #endregion

        #region Properties

            /// <summary>
            /// The ID of the associated Visit 
            /// </summary>
            public static PropertyInfo<Nullable<Guid>> VisitGUIDProperty = RegisterProperty<Nullable<Guid>>(p => p.VisitGUID);
            /// <summary>
            /// The ID of the associated Visit 
            /// </summary>
            public Nullable<Guid> VisitGUID
            {
                get { return GetProperty(VisitGUIDProperty); }
                set { SetProperty(VisitGUIDProperty, value); }
            }

            /// <summary>
            /// The GUID of the associated VisitEventType
            /// </summary>
            public static PropertyInfo<Nullable<Guid>> VisitEventTypeGUIDProperty = RegisterProperty<Nullable<Guid>>(p => p.VisitEventTypeGUID);
            /// <summary>
            /// The GUID of the associated VisitEventType
            /// </summary>
            public Nullable<Guid> VisitEventTypeGUID
            {
                get { return GetProperty(VisitEventTypeGUIDProperty); }
                set { SetProperty(VisitEventTypeGUIDProperty, value); }
            }

        #endregion

    }
}
